package com.ljf.daily.makemoneysoftware.web;

import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ResultModel;
import com.ljf.common.validation.QueryGroup;
import com.ljf.common.validation.UpdateGroup;
import com.ljf.common.web.BasisController;
import com.ljf.daily.makemoneysoftware.dto.command.DailyDatMakeMoneySoftwareCommand;
import com.ljf.daily.makemoneysoftware.dto.command.DailyDatMakeMoneySoftwareConfigCommand;
import com.ljf.daily.makemoneysoftware.dto.query.DailyDatMakeMoneySoftwareQuery;
import com.ljf.daily.makemoneysoftware.service.IDailyDatMakeMoneySoftwareService;
import com.ljf.daily.makemoneysoftware.vo.DailyDatMakeMoneySoftwareVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 赚钱软件定义  控制器
 *
 * @author LJF
 * @since 2024-02-26
 */
@RestController
@RequestMapping("/daily/dat/make_money_software")
@Api(value = "赚钱软件定义接口", tags = "赚钱软件定义接口")
public class DailyDatMakeMoneySoftwareController extends BasisController<IDailyDatMakeMoneySoftwareService, DailyDatMakeMoneySoftwareQuery, DailyDatMakeMoneySoftwareVO, DailyDatMakeMoneySoftwareCommand> {

    @PutMapping("/config")
    @ApiOperation(value = "更新配置接口")
    public ResultModel editConfig(@RequestBody @Validated(UpdateGroup.class) DailyDatMakeMoneySoftwareConfigCommand command) throws ServiceException {
        return service.editConfig(command);
    }

    @GetMapping("/config")
    @ApiOperation(value = "配置分页查询接口")
    public ResultModel queryConfig(@Validated(QueryGroup.class) DailyDatMakeMoneySoftwareQuery query) throws ServiceException {
        return service.queryConfig(query);
    }

    @GetMapping("/list/execute_insert")
    @ApiOperation(value = "新增执行软件查询接口")
    public ResultModel queryListExecuteInsert(@Validated(QueryGroup.class) DailyDatMakeMoneySoftwareQuery query) throws ServiceException {
        return service.queryListExecuteInsert(query);
    }

}
